import Vue from 'vue'
import Vuex from 'vuex'
import request from "../utils/request"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
      list:[]
  },
  mutations: {
    // SetState(state,payload){
    //   state[payload.key]=payload.value
    // }
    GET_LIST(state,data){
      state.list=data
    }
  },
  actions: {
    GetList(context){
     request.get("/getList").then(res=>{
        context.commit("GET_LIST",res.data)
        console.log("res.dd",res.data)
      })
    }
  },
  modules: {
  }
})
